package com.hlf.modules.sys.entity;

import com.hlf.modules.base.entity.BaseModel;

import java.util.Date;

/**
 * 系统操作日志实体类
 * 
 * 
 * @author shuliangxing
 * 
 * @date 2015-9-22上午10:55:02
 */
public class SysLog extends BaseModel {
    /**
     *
     */
    private static final long serialVersionUID = 210229884180830316L;

    /**
     * id
     */
    private Long logId;

    /**
     * 操作人id,0为匿名用户
     */
    private Long useId;

    /**
     * ip地址
     */
    private String logIp;

    /**
     * 模块名称
     */
    private String logModule;

    /**
     * 操作名称
     */
    private String logOperation;

    /**
     * 方法名
     */
    private String logMethod;

    /**
     * 请求参数
     */
    private String logParam;

    /**
     * 异常信息
     */
    private String logException;

    /**
     * 异常堆栈信息
     */
    private String logStackTrace;

    /**
     * 操作时间
     */
    private Date logTime;

    /**
     * 操作时长,单位毫秒
     */
    private Long logDuration;

    /**
     * 结果, 0:异常 1:正常 2:业务错误(业务异常)
     */
    private Integer logResult;

    /**
     * 操作分组,同样的值为一组,即同一个请求
     */
    private Long logGroup;

    /**
     * 操作类型, -1:未定义 0:其它 1:新增 2:删除 3修改 4:查询 5:登录 6:发送短信 7:发送邮件
     */
    private Integer logType;

    /**
     * 请求类型,如:get post put
     */
    private String logReqMethod;

    /**
     * 请求url
     */
    private String logUrl;

    public Long getLogId() {
        return logId;
    }

    public void setLogId(Long logId) {
        this.logId = logId;
    }

    public Long getUseId() {
        return useId;
    }

    public void setUseId(Long useId) {
        this.useId = useId;
    }

    public String getLogIp() {
        return logIp;
    }

    public void setLogIp(String logIp) {
        this.logIp = logIp == null ? null : logIp.trim();
    }

    public String getLogModule() {
        return logModule;
    }

    public void setLogModule(String logModule) {
        this.logModule = logModule == null ? null : logModule.trim();
    }

    public String getLogOperation() {
        return logOperation;
    }

    public void setLogOperation(String logOperation) {
        this.logOperation = logOperation == null ? null : logOperation.trim();
    }

    public String getLogMethod() {
        return logMethod;
    }

    public void setLogMethod(String logMethod) {
        this.logMethod = logMethod == null ? null : logMethod.trim();
    }

    public String getLogParam() {
        return logParam;
    }

    public void setLogParam(String logParam) {
        this.logParam = logParam == null ? null : logParam.trim();
    }

    public String getLogException() {
        return logException;
    }

    public void setLogException(String logException) {
        this.logException = logException == null ? null : logException.trim();
    }

    public String getLogStackTrace() {
        return logStackTrace;
    }

    public void setLogStackTrace(String logStackTrace) {
        this.logStackTrace = logStackTrace == null ? null : logStackTrace
                .trim();
    }

    public Date getLogTime() {
        return logTime;
    }

    public void setLogTime(Date logTime) {
        this.logTime = logTime;
    }

    public Long getLogDuration() {
        return logDuration;
    }

    public void setLogDuration(Long logDuration) {
        this.logDuration = logDuration;
    }

    public Integer getLogResult() {
        return logResult;
    }

    public void setLogResult(Integer logResult) {
        this.logResult = logResult;
    }

    public Long getLogGroup() {
        return logGroup;
    }

    public void setLogGroup(Long logGroup) {
        this.logGroup = logGroup;
    }

    public Integer getLogType() {
        return logType;
    }

    public void setLogType(Integer logType) {
        this.logType = logType;
    }

    public static long getSerialversionuid() {
        return serialVersionUID;
    }

    public String getLogReqMethod() {
        return logReqMethod;
    }

    public void setLogReqMethod(String logReqMethod) {
        this.logReqMethod = logReqMethod;
    }

    public String getLogUrl() {
        return logUrl;
    }

    public void setLogUrl(String logUrl) {
        this.logUrl = logUrl;
    }

    @Override
    public String toString() {
        return "SysLog [logId=" + logId + ", useId=" + useId + ", logIp="
                + logIp + ", logModule=" + logModule + ", logOperation="
                + logOperation + ", logMethod=" + logMethod + ", logParam="
                + logParam + ", logException=" + logException
                + ", logStackTrace=" + logStackTrace + ", logTime=" + logTime
                + ", logDuration=" + logDuration + ", logResult=" + logResult
                + ", logGroup=" + logGroup + ", logType=" + logType
                + ", logReqMethod=" + logReqMethod + ", logUrl=" + logUrl + "]";
    }

}